﻿<%@ Page Language="C#" MasterPageFile="~/GUI/Site1.Master" AutoEventWireup="true" CodeBehind="register.aspx.cs" Inherits="wdss.GUI.register" Title="Register" %>
<asp:Content ID="Content2" ContentPlaceHolderID="contentNew" runat="server">

    <form id="FormRegister">
    
    
    <table align =center>
    <tr>
    <td align =center ><asp:Label runat = server ForeColor = White Font-Bold = true 
    Text="Instruction"></asp:Label>
    </td>
    </tr>
     <tr>
    <td align =center>
  <asp:Label runat = server ForeColor = White Font-Bold = true 
    Text="1. Please don't use the same email id as password."></asp:Label>
    </td>
    </tr>
     <tr>
    <td align=center>
     <asp:Label ID="Label1" runat = server ForeColor = White Font-Bold = true 
    Text="1. 2. Password should be 7 character long and should contain 1 letter 1 number and 1 symbol."></asp:Label>
  </td></tr>
  <tr>
  <td align =center>
  <asp:Label ID="Label2" runat = server ForeColor = White Font-Bold = true 
    Text="Allowed symbols are ' @#$\()*%^&+= ' "></asp:Label>
    </td>
    </tr>
    </table>
 
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>" 
            SelectCommand="SELECT [dept_name], [dept_ID] FROM [Department]" 
            ProviderName="System.Data.SqlClient">
        </asp:SqlDataSource>      
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>" 
            SelectCommand="SELECT [role_name], [role_ID] FROM [Role]" 
            ProviderName="System.Data.SqlClient">
        </asp:SqlDataSource>
        <br />
        <!-- </form> 
        <form id ="regform" style="height: 554px"> -->
        <table align=center>
        <tr>  <td><asp:Label ID="lbl_Result" runat="server" Font-Bold="True" 
            ForeColor="White"></asp:Label>
                  </td>              
                            </tr>
                            </table>
        <table border="20" align=center>
        <tr>
         <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d">
                  Sign Up for Your New Account                  
         </td>
         </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:Label ID="lbl_Error" runat="server" Visible="false" ForeColor="Red"></asp:Label>
                                        </td>
                                       
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:Label ID="lbl_Username" runat="server" AssociatedControlID="Username" 
                                                Font-Bold="True" ForeColor="White">
                                                 E-mail:</asp:Label></td>
                                  <td align="left">
                                            <asp:TextBox ID="Username" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv_Email" runat="server" ControlToValidate="Username"
                                                ErrorMessage="Email is required." ToolTip="Email is required.">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                           <tr>
                                        <td align="left">
                                            <asp:Label ID="lbl_Password" runat="server" AssociatedControlID="Password" 
                                                Font-Bold="True" ForeColor="White">Password:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="Password" runat="server" TextMode="Password" MaxLength="100" Width="200px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv_Password" runat="server" ControlToValidate="Password"
                                             ErrorMessage="Password is required." ToolTip="Password is required.">*</asp:RequiredFieldValidator>
                                            <%--<asp:RegularExpressionValidator ID="rev_Password" runat="server" ControlToValidate="Password"
                                             ErrorMessage="Password is not 6 characters or more." ToolTip="Password must be 6 characters or more."
                                             ValidationGroup="CreatUserWizard" ValidationExpression="([A-z]|[0-9]){6,100}"></asp:RegularExpressionValidator>
                                             --%>
                                        </td>    
                                    </tr>
                            <tr>
                                        <td align="left">
                                            <asp:Label ID="lbl_ConfirmPassword" runat="server" 
                                                AssociatedControlID="txt_ConfirmPassword" Font-Bold="True" ForeColor="White">Confirm Password:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txt_ConfirmPassword" runat="server" Width="200px" TextMode="Password" MaxLength="100"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv_ConfirmPassword" runat="server" ControlToValidate="txt_ConfirmPassword"
                                             ErrorMessage="Confirm Password is required." ToolTip="Please repeat your password.">*</asp:RequiredFieldValidator>
                                            <%--<asp:RegularExpressionValidator ID="rev_confirmPassword" runat="server" ControlToValidate="txt_ConfirmPassword"
                                             ErrorMessage="Password is not 6 characters or more." ToolTip="Password must be 6 characters or more."
                                             ValidationGroup="CreateUserWizard" ValidationExpression="([A-z]|[0-9]){6,100}"></asp:RegularExpressionValidator>
                                            --%>
                                        </td>
                            </tr>
                            <tr>
                                        <td align="left">
                                            <asp:Label ID="lbl_Request" runat="server" AssociatedControlID="txt_Request" 
                                                Font-Bold="True" ForeColor="White">Request:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txt_Request" runat="server" TextMode="MultiLine" MaxLength="3000" Width="200px"></asp:TextBox> 
                                            <asp:RequiredFieldValidator ID="rfv_Request" runat="server" ControlToValidate="txt_Request"
                                             ErrorMessage="Need a request." ToolTip="Place organizational request here.">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:Label id="lbl_Role" runat="server" AssociatedControlID="RoleList" 
                                                Font-Bold="True" ForeColor="White">Role:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:DropDownList ID="RoleList" runat="server" DataSourceID="SqlDataSource1" 
                                                DataTextField="role_name" DataValueField="role_ID" Height="26px" 
                                                Width="200px">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfv_RoleList" runat="server" ControlToValidate="RoleList"
                                            ErrorMessage="Choose a Role">*</asp:RequiredFieldValidator>               
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:Label ID="lbl_Department" runat="server" 
                                                AssociatedControlID="DepartmentList" Font-Bold="True" ForeColor="White">Department:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:DropDownList ID="DepartmentList" runat="server" 
                                                DataSourceID="SqlDataSource2" DataTextField="dept_name" 
                                                DataValueField="dept_ID" Height="27px" Width="200px">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfv_DepartmentList" runat="server" ControlToValidate="DepartmentList"
                                            ErrorMessage="Choose a Role">*</asp:RequiredFieldValidator>   
                                        </td>
                                    </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email"
                                        Font-Bold="True" ForeColor="White">Alternate 
                                    Email:</asp:Label>
                                </td>
                                <td align=left>
                                    <asp:TextBox ID="Email" runat="server" Width = 200px></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                        ControlToValidate="Email" ErrorMessage="E-mail is required." 
                                        ToolTip="E-mail is required.">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question" 
                                        Font-Bold="True" ForeColor="White">Security 
                                    Question:</asp:Label>
                                </td>
                                <td align=left>
                                    <asp:TextBox ID="Question" runat="server" Width="200px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" 
                                        ControlToValidate="Question" ErrorMessage="Security question is required." 
                                        ToolTip="Security question is required.">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer" 
                                        Font-Bold="True" ForeColor="White">Security 
                                    Answer:</asp:Label>
                                </td>
                                <td align=left>
                                    <asp:TextBox ID="Answer" runat="server" Width="200px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" 
                                        ControlToValidate="Answer" ErrorMessage="Security answer is required." 
                                        ToolTip="Security answer is required.">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                        ControlToCompare="Password" ControlToValidate="txt_ConfirmPassword" 
                                        Display="Dynamic" 
                                        ErrorMessage="The Password and Confirmation Password must match.">
                                        </asp:CompareValidator>
                                </td>
                            </tr>
                            
                            <tr> <td align="center" colspan="2">
                            
                                <asp:Button ID="btn_reg" runat="server" onclick="btn_reg_Click" 
                                    Text="Sign Up" style="height: 26px" BackColor="Black" Font-Bold="True" 
                                    ForeColor="White" />
                            
                            </td>
                            </tr>
                            <tr>
                            <td align="center" colspan="2" style="color:Red;">
                                    <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                </td>
                            </tr>
                        </table>
                    
                       

    </form>
   </asp:Content>

